package cn.com.connext.scrm.service;

import cn.com.connext.scrm.domain.master.BuryingPointBaileysAuthor;
import cn.com.connext.scrm.repository.master.BuryingPointBaileysAuthorRepository;
import cn.com.connext.scrm.service.dto.JsonResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
public class BuryingPointBaileysAuthorService {
        @Autowired
        private BuryingPointBaileysAuthorRepository amcRepository;

        public JsonResult saveAuthor(BuryingPointBaileysAuthor entity) {
            JsonResult result =new JsonResult();
            if(StringUtils.isEmpty(entity.getUnionId())){
                result.setMessage("用户参数不能为空!");
                result.setState(-1);
            }else{
                amcRepository.saveAndFlush(entity);
                result.setMessage("添加成功");
                result.setState(0);
            }
            return result;
        }

}
